
local indata LAD\Data
local infile LAD\Data_Cleaning

use "`indata'\LAD_Crowdout.dta", clear

do "`infile'\LAD_Commands_filtering.do"

*Focus on savers within the relevant bandwidth
keep if empinc>=-6000 & empinc<6000

*Non-Unionized RPP Non-Members do not satisfy the Test of Running Variable and are excluded
keep if dues>0
*Focus on RPP members with strictly positive RRSP contributions
keep if penadj>0 & rspcont>0

local covars age agesq female married province_* selfempinc_flag eiinc_flag othinc disab medexp

*--------------------
*1) Interior, primary
*--------------------

ivreg2 rspcont (penadj = empinc_kink) empinc `covars' if rspcont<rspdlc & (penadjl+rspcont)<contlimit, cl(id) first
test penadj=-1

*--------
*2) Limit
*--------

ivreg2 rspcont (penadj = empinc_kink) empinc `covars' if rspcont>=rspdlc | (penadjl+rspcont)>=contlimit, cl(id) first
test penadj=-1

*----------------
*3) Unconstrained
*----------------

ivreg2 rspcont (penadj = empinc_kink) empinc `covars', cl(id) first
test penadj=-1

exit
